# Out directory

out.dir = '/home1/99/jc152199/ChapterOne/'

#### Read in model contributions

bc.summary = read.csv('/home1/99/jc152199/MAXENT/output/COPMONT/BIOCLIM/output/maxentResults.csv', header=T)
mc.summary = read.csv('/home1/99/jc152199/MAXENT/output/COPMONT/microCLIM/output/maxentResults.csv', header=T)

### Form some data frames

bc.contribs = data.frame(model='BIOCLIM',bc.summary[,c(8:16)])
mc.contribs = data.frame(model='microCLIM',mc.summary[,c(8:16)])

### Reorder

mc.contribs = mc.contribs[,c(1,2,7,8,9,10,3,4,5,6)]

### Rename

names(mc.contribs) = c('model','BVG','MAT','MAT CofV','Max Mean Monthly Maxs','Min Mean Monthly Mins','MAP','Precip of Wettest','Precip of Driest','Precip Seasonality')
names(bc.contribs) = c('model','BVG','MAT','MAT CofV','Max Mean Monthly Maxs','Min Mean Monthly Mins','MAP','Precip of Wettest','Precip of Driest','Precip Seasonality')

### Row bind

outdata = rbind(bc.contribs,mc.contribs)

# Round

outdata[,c(3:10)] = round(outdata[,c(3:10)],2)

### Table 6

write.csv(outdata, file=paste(out.dir,'Tables/Table6.csv',sep=''), row.names=F)